﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace Gwn.Library.MvpVm.Interfaces
{
    /// <summary>
    /// User controller interface
    /// </summary>
    public interface IUserControl : IView
    {
        /// <summary>
        /// Occurs when [loaded].
        /// </summary>
        event RoutedEventHandler Loaded;

        /// <summary>
        /// Occurs when [unloaded].
        /// </summary>
        event RoutedEventHandler Unloaded;

        /// <summary>
        /// Occurs when [is enabled changed].
        /// </summary>
        event DependencyPropertyChangedEventHandler IsEnabledChanged;

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        string Name { get; set; }

        /// <summary>
        /// Gets or sets the tag.
        /// </summary>
        /// <value>The tag.</value>
        object Tag { get; set; }

        /// <summary>
        /// Gets or sets the cursor.
        /// </summary>
        /// <value>The cursor.</value>
        Cursor Cursor { get; set; }

        /// <summary>
        /// Gets the actual width.
        /// </summary>
        /// <value>The actual width.</value>
        double ActualWidth { get; }

        /// <summary>
        /// Gets the actual height.
        /// </summary>
        /// <value>The actual height.</value>
        double ActualHeight { get; }

        /// <summary>
        /// Gets or sets the width.
        /// </summary>
        /// <value>The width.</value>
        double Width { get; set; }

        /// <summary>
        /// Gets or sets the height.
        /// </summary>
        /// <value>The height.</value>
        double Height { get; set; }

        /// <summary>
        /// Gets or sets the width of the min.
        /// </summary>
        /// <value>The width of the min.</value>
        double MinWidth { get; set; }

        /// <summary>
        /// Gets or sets the width of the max.
        /// </summary>
        /// <value>The width of the max.</value>
        double MaxWidth { get; set; }

        /// <summary>
        /// Gets or sets the height of the min.
        /// </summary>
        /// <value>The height of the min.</value>
        double MinHeight { get; set; }

        /// <summary>
        /// Gets or sets the height of the max.
        /// </summary>
        /// <value>The height of the max.</value>
        double MaxHeight { get; set; }

        /// <summary>
        /// Gets or sets the horizontal alignment.
        /// </summary>
        /// <value>The horizontal alignment.</value>
        HorizontalAlignment HorizontalAlignment { get; set; }

        /// <summary>
        /// Gets or sets the vertical alignment.
        /// </summary>
        /// <value>The vertical alignment.</value>
        VerticalAlignment VerticalAlignment { get; set; }

        /// <summary>
        /// Gets or sets the margin.
        /// </summary>
        /// <value>The margin.</value>
        Thickness Margin { get; set; }

        /// <summary>
        /// Gets or sets the style.
        /// </summary>
        /// <value>The style.</value>
        Style Style { get; set; }

        /// <summary>
        /// Gets the parent.
        /// </summary>
        /// <value>The parent.</value>
        DependencyObject Parent { get; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is tab stop.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is tab stop; otherwise, <c>false</c>.
        /// </value>
        bool IsTabStop { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is enabled.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is enabled; otherwise, <c>false</c>.
        /// </value>
        bool IsEnabled { get; set; }

        /// <summary>
        /// Gets or sets the index of the tab.
        /// </summary>
        /// <value>The index of the tab.</value>
        int TabIndex { get; set; }

#if !GWNDESKTOP
        /// <summary>
        /// Gets or sets the tab navigation.
        /// </summary>
        /// <value>The tab navigation.</value>
        KeyboardNavigationMode TabNavigation { get; set; }
#endif

        /// <summary>
        /// Gets or sets the template.
        /// </summary>
        /// <value>The template.</value>
        ControlTemplate Template { get; set; }

        /// <summary>
        /// Gets or sets the padding.
        /// </summary>
        /// <value>The padding.</value>
        Thickness Padding { get; set; }

        /// <summary>
        /// Gets or sets the border thickness.
        /// </summary>
        /// <value>The border thickness.</value>
        Thickness BorderThickness { get; set; }

        /// <summary>
        /// Gets or sets the horizontal content alignment.
        /// </summary>
        /// <value>The horizontal content alignment.</value>
        HorizontalAlignment HorizontalContentAlignment { get; set; }

        /// <summary>
        /// Gets or sets the vertical content alignment.
        /// </summary>
        /// <value>The vertical content alignment.</value>
        VerticalAlignment VerticalContentAlignment { get; set; }

        /// <summary>
        /// Gets or sets the background.
        /// </summary>
        /// <value>The background.</value>
        Brush Background { get; set; }

        /// <summary>
        /// Gets or sets the border brush.
        /// </summary>
        /// <value>The border brush.</value>
        Brush BorderBrush { get; set; }

        /// <summary>
        /// Gets or sets the font family.
        /// </summary>
        /// <value>The font family.</value>
        FontFamily FontFamily { get; set; }

        /// <summary>
        /// Gets or sets the size of the font.
        /// </summary>
        /// <value>The size of the font.</value>
        double FontSize { get; set; }

        /// <summary>
        /// Gets or sets the font stretch.
        /// </summary>
        /// <value>The font stretch.</value>
        FontStretch FontStretch { get; set; }

        /// <summary>
        /// Gets or sets the font style.
        /// </summary>
        /// <value>The font style.</value>
        FontStyle FontStyle { get; set; }

        /// <summary>
        /// Gets or sets the font weight.
        /// </summary>
        /// <value>The font weight.</value>
        FontWeight FontWeight { get; set; }

        /// <summary>
        /// Gets or sets the foreground.
        /// </summary>
        /// <value>The foreground.</value>
        Brush Foreground { get; set; }

        /// <summary>
        /// Focuses this instance.
        /// </summary>
        /// <returns></returns>
        bool Focus();

        /// <summary>
        /// Finds the name.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="controlName">Name of the control.</param>
        /// <returns></returns>
        T FindChildName<T>(string controlName) where T : DependencyObject;
        
        /// <summary>
        /// Applies the template.
        /// </summary>
        /// <returns></returns>
        bool ApplyTemplate();
    }
}
